import 'package:flutter/material.dart';
import 'package:pp_uikit/bottom_sheet/pp_action_sheet_theme.dart';
import 'package:pp_uikit/bottom_sheet/pp_common_action_sheet.dart';
import 'package:pp_uikit/bottom_sheet/pp_common_action_sheet_item.dart';
import 'package:pp_uikit/bottom_sheet/pp_common_image_action_sheet.dart';

class PPBottomSheet {
  static void show(
    BuildContext context, {
    String? title,
    String? message,
    Widget? contentWidget,
    required List<PPCommonActionSheetItem> actions,
    PPCommonActionSheetItemClickCallBack? onItemClick, // Action Item 的点击事件
    PPCommonActionSheetItemClickInterceptor?
        onItemClickInterceptor, // Action Item 点击事件拦截回调
  }) {
    showModalBottomSheet(
        context: context,
        backgroundColor: Colors.transparent,
        builder: (BuildContext context) {
          return PPCommonActionSheet(
            title: title,
            actions: actions,
            clickCallBack: onItemClick,
            onItemClickInterceptor: onItemClickInterceptor,
          );
        });
  }

  static void showImageStyle(
    BuildContext context, {
    String? cancelTitle = "取消",
    PPActionSheetTheme? themeData,
    PPCommonActionSheetItemClickCallBack? onItemClick, // Action Item 的点击事件
    PPCommonActionSheetItemClickInterceptor?
        onItemClickInterceptor, // Action Item 点击事件拦截回调
    required List<PPCommonActionSheetItem> actions,
  }) {
    showModalBottomSheet(
        context: context,
        backgroundColor: Colors.transparent,
        builder: (BuildContext context) {
          return PPImageSingleSelectionActionSheet(
            actions: actions,
            themeData: themeData,
            clickCallBack: onItemClick,
            onItemClickInterceptor: onItemClickInterceptor,
          );
        });
  }
}
